package milktea.service.impl;

import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;

import milktea.dao.IProductDao;
import milktea.dao.impl.ProductDao;
import milktea.model.Product;
import milktea.service.IProductService;

public class ProductService implements IProductService {

	@Override
	public int insert(Product product) throws SQLException {
		IProductDao ptdao = new ProductDao();
		int rows = ptdao.insert(product);
		return rows;
	}

	@Override
	public List<Product> select() throws SQLException {
		List<Product> list = new ArrayList<Product>();
		IProductDao ptdao = new ProductDao();
		list = ptdao.select();
		return list;
	}

}
